package graduation.service.Impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import graduation.dao.FilesDao;
import graduation.entity.Files;
import graduation.service.FilesService;
import graduation.vo.PageVO;
@Service
@Transactional
public class FilesServiceImpl implements FilesService{
	@Autowired
	private FilesDao filesDaoImpl;
	/**
	 * 上传文件
	 */
	@Override
	public void uploadFiles(Files files) {
		// TODO Auto-generated method stub
		filesDaoImpl.uploadFiles(files);
	}
	/**
	 * 删除
	 */
	@Override
	public void delFiles(String fileId) {
		// TODO Auto-generated method stub
		filesDaoImpl.delFiles(fileId);
	}
	/**
	 * 通过id查询
	 */
	@Override
	public Files getFilesById(String fileId) {
		// TODO Auto-generated method stub
		return filesDaoImpl.getFilesById(fileId);
	}
	/**
	 * 根据文件名模糊查找 
	 */
	@Override
	public List findFileByName(String filesName,int type) {
		// TODO Auto-generated method stub
		List list = filesDaoImpl.findFileByName(filesName,type);
		return list;
	}
	/**
	 * 按照上传最新时间排序，参数page，size实现分页功能
	 */
	@Override
	public PageVO getFiles(int page, int size) {
		// TODO Auto-generated method stub
		PageVO pageMessage = filesDaoImpl.getFiles(page, size);
		return pageMessage;
	}
	/**
	 * 根据type获取文件
	 */
	@Override
	public List getFilesByType(int type) {
		// TODO Auto-generated method stub
		return filesDaoImpl.getFilesByType(type);
	}
	@Override
	public void delFiles(Files files) {
		// TODO Auto-generated method stub
		filesDaoImpl.delFiles(files);
	}
	@Override
	public PageVO getFiles(int page, int size, int type) {
		// TODO Auto-generated method stub
		return filesDaoImpl.getFiles(page, size,type);
	}

}
